﻿using System;
using System.Collections.Generic;
using System.Text;

namespace BSE.Windows.Test
{
    public class Yaopin
    {
        private string yaopinCode = "";
        private string yaopinName = "";
        private string yaopinGuige = "";
        private string yaopinDanwei = "";
        private string yaopinID = "";
        private string yaopinBatch = "";

        public string YaopinCode
        {
            get { return yaopinCode; }
            set { yaopinCode = value; }
        }

        public string YaopinName
        {
            get { return yaopinName; }
            set { yaopinName = value; }
        }

        public string YaopinGuige
        {
            get { return yaopinGuige; }
            set { yaopinGuige = value; }
        }

        public string YaopinDanwei
        {
            get { return yaopinDanwei; }
            set { yaopinDanwei = value; }
        }

        public string YaopinID
        {
            get { return yaopinID; }
            set { yaopinID = value; }
        }

        public string YaopinBatch
        {
            get { return yaopinBatch; }
            set { yaopinBatch = value; }
        }

        public string YaopinLongName
        {
            get
            {
                if (yaopinCode.Length > 0 && yaopinName.Length > 0 && yaopinGuige.Length > 0 && yaopinDanwei.Length > 0)
                    return yaopinCode + "-" + yaopinName + "-" + yaopinGuige + "/" + yaopinDanwei;
                else
                    return yaopinName;
            }
        }

        public Yaopin Clone()
        {
            Yaopin y = new Yaopin();
            y.YaopinCode = this.yaopinCode;
            y.YaopinName = this.yaopinName;
            y.YaopinID = this.yaopinID;
            y.YaopinGuige = this.yaopinGuige;
            y.YaopinDanwei = this.yaopinDanwei;
            y.YaopinBatch = this.YaopinBatch;

            return y;
        }
    }
}
